﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BemEstarEmprego.Web.Controllers;

namespace BemEstarEmprego.Web.Helpers
{
	public class SecurityFilter : ActionFilterAttribute
	{
		public override void OnActionExecuting(ActionExecutingContext filterContext)
		{
			BaseController controller = (BaseController)filterContext.Controller;
			if (controller.userSession.Usuario == null)
			{
				filterContext.Result = new RedirectResult("/Home/Index");
			}
		}
	}
}